import request from '@/utils/request'

// 查询日志列表
export function getLogList(query) {
  return request({
    url: '/lock/log/list',
    method: 'get',
    params: query
  })
}

// 查询日志详情
export function getLogDetail(id) {
  return request({
    url: '/lock/log/' + id,
    method: 'get'
  })
}

// 导出日志
export function exportLogs(query) {
  return request({
    url: '/lock/log/export',
    method: 'get',
    params: query
  })
}

// 查询报警日志
export function getAlarmLogs(query) {
  return request({
    url: '/lock/log/alarm',
    method: 'get',
    params: query
  })
}

// 查询操作日志
export function getOperationLogs(query) {
  return request({
    url: '/lock/log/operation',
    method: 'get',
    params: query
  })
}

// 删除日志
export function deleteLog(id) {
  return request({
    url: '/lock/log/' + id,
    method: 'delete'
  })
}

// 批量删除日志
export function batchDeleteLogs(ids) {
  return request({
    url: '/lock/log/batchDelete',
    method: 'delete',
    data: { ids }
  })
}

// 清空日志
export function clearLogs(type) {
  return request({
    url: '/lock/log/clear',
    method: 'delete',
    params: { type }
  })
} 